<template>
  <div class="we_component we_video">
    <div class="novideo" v-if="!data.url">
      <i class="icon icon-shipin"></i>
      <p class="tip" style="text-align:center;">请选择视频</p>
    </div>
    <video v-else controls="controls" :poster="data.cover" style="width:100%;">
      <source :src="data.url" type="video/mp4">
      您的浏览器不支持 video 标签。
    </video>
  </div>
</template>
<script>
  export default {
    props: ['data']
  }
</script>
<style lang="scss">
  .we_video{
    .novideo{padding-bottom:10px;text-align:center;line-height:1;color:#ccc;}
    .tip{margin-top:-10px;}
    .icon{font-size:100px;color:#ccc;}
  }
</style>
